<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" th:href="@{/plugins/layui/css/layui.css}" media="all">
</head>
<body>

<form class="layui-form layui-form-pane">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">订单编号</label>
            <div class="layui-input-inline">
                <input type="tel" th:value="${order.orderId}" name="" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">生产线：</label>
            <div class="layui-input-inline">
                <select name='sldd' lay-filter="aihao">
                    <option value='' selected>请选择</option>
                    <option value=''>生产线1号</option>
                    <option value=''>生产线2号</option>
                    <option value=''>生产线3号</option>
                    <option value=''>生产线4号</option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">生产编号：</label>
            <div class="layui-input-inline">
                <input type="tel" th:value="${order.productPlanNo}" name="" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">生产时间：</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test5" placeholder="yyyy-MM-dd HH:mm:ss">
            </div>
    </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>


</form>

<script th:src="@{/plugins/layui/layui.js}"></script>
<script>
    layui.use('form','jquery','element','laydate', function(){
        var form = layui.form;
        var element = layui.element;
        var laydate = layui.laydate;
        var $ = layui.jquery;
        laydate.render({
            elem: '#test5'
            ,type: 'datetime'
        });

        form.on('submit(demo1)', function(data){
            // $.ajax({
            //     url:'/order/add'
            //     ,type:'post'
            //     ,success: function(msg){
            //         if (msg.rs){
            //             parent.layer.msg("成功！",{icon:1});
            //             // parent.layui.table.reload("test")
            //             var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            //             parent.layer.close(index); //再执行关闭
            //         }else {
            //             layer.msg("失败！",{icon:2});
            //         }
            //     }
            // });
            $.ajax({
                type: "POST",
                url: "/order/add",
                data: "",
                success: function(msg){
                    layer.msg("成功！",{icon:1});
                }
            });




            return false;
        });

    });
</script>
</body>
</html>